'use strict';

const Controller = require('egg').Controller;

class ApidetailController extends Controller {
  async apiDetail() {
    const { ctx } = this
    const { id } = ctx.params
    const result = await ctx.service.api.findApiById(id)
    if (result == null) {
      ctx.body = {
        code: 0,
        msg: '没有该条记录'
      }
      return false
    }
    ctx.body = {
      code: 1,
      result
    }
  }
}

module.exports = ApidetailController;
